<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Prevent dotnet template engine to parse this file -->
  <!--/-:cnd:noEmit-->
  <PropertyGroup>
    <!-- make MSBuild track this file for incremental builds. -->
    <!-- ref https://blogs.msdn.microsoft.com/msbuild/2005/09/26/how-to-ensure-changes-to-a-custom-target-file-prompt-a-rebuild/ -->
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
    <!-- Mark that this target file has been loaded.  -->
    <IsPaketRestoreTargetsFileLoaded>true</IsPaketRestoreTargetsFileLoaded>
    <PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
    <PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
    <PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
    <PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
    <PaketBootstrapperStyle>classic</PaketBootstrapperStyle>
    <PaketBootstrapperStyle Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">proj</PaketBootstrapperStyle>
    <PaketExeImage>assembly</PaketExeImage>
    <PaketExeImage Condition=" '$(PaketBootstrapperStyle)' == 'proj' ">native</PaketExeImage>
    <MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
    <MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>

    <!-- PaketBootStrapper  -->
    <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
    <PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
    <PaketBootStrapperExeDir Condition=" Exists('$(PaketBootStrapperExePath)') " >$([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\</PaketBootStrapperExeDir>

    <!-- Paket -->

    <!-- windows, root => tool => proj style => bootstrapper => global -->
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketRootPath)paket.exe') ">$(PaketRootPath)paket.exe</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND '$(PaketBootstrapperStyle)' == 'proj' ">$(PaketToolsPath)paket.exe</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketBootStrapperExeDir)') ">$(_PaketBootStrapperExeDir)paket.exe</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">paket.exe</PaketExePath>

    <!-- no windows, try native paket as default,  root => tool => proj style => mono paket => bootstrpper => global -->
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketRootPath)paket') ">$(PaketRootPath)paket</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketToolsPath)paket') ">$(PaketToolsPath)paket</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketBootstrapperStyle)' == 'proj' ">$(PaketToolsPath)paket</PaketExePath>

    <!-- no windows, try mono paket -->
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketRootPath)paket.exe') ">$(PaketRootPath)paket.exe</PaketExePath>
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath>

    <!-- no windows, try bootstrapper -->
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketBootStrapperExeDir)') ">$(PaketBootStrapperExeDir)paket.exe</PaketExePath>

    <!-- no windows, try global native paket -->
    <PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' ">paket</PaketExePath>

    <!-- Paket command -->
    <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
    <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
    <PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
    <PaketCommand Condition=" '$(PaketCommand)' == '' ">"$(PaketExePath)"</PaketCommand>


    <PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
    <PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>

    <!-- Disable automagic references for F# dotnet sdk -->
    <!-- This will not do anything for other project types -->
    <!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
    <DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
    <DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

    <!-- Disable Paket restore under NCrunch build -->
    <PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
  </PropertyGroup>

  <Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
    <MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" />
  </Target>

  <Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping">

    <!-- Step 1 Check if lockfile is properly restored -->
    <PropertyGroup>
      <PaketRestoreRequired>true</PaketRestoreRequired>
      <NoWarn>$(NoWarn);NU1603;NU1604;NU1605;NU1608</NoWarn>
    </PropertyGroup>

    <!-- Because ReadAllText is slow on osx/linux, try to find shasum and awk -->
    <PropertyGroup>
      <PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum "$(PaketRestoreCacheFile)" | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher>
      <PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum "$(PaketLockFilePath)" | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher>
    </PropertyGroup>

    <!-- If shasum and awk exist get the hashes -->
    <Exec StandardOutputImportance="Low" Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'>
      <Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" />
    </Exec>
    <Exec StandardOutputImportance="Low" Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'>
      <Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
    </Exec>

    <!-- Debug whats going on -->
    <Message Importance="low" Text="calling paket restore with targetframework=$(TargetFramework) targetframeworks=$(TargetFrameworks)" />

    <PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
      <!-- if no hash has been done yet fall back to just reading in the files and comparing them -->
      <PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
      <PaketRestoreLockFileHash Condition=" '$(PaketRestoreLockFileHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
      <PaketRestoreRequired>true</PaketRestoreRequired>
      <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
      <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
    </PropertyGroup>

	<!-- 
		This value should match the version in the props generated by paket 
		If they differ, this means we need to do a restore in order to ensure correct dependencies
	-->
    <PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
      <PaketRestoreRequired>true</PaketRestoreRequired>
    </PropertyGroup>

    <!-- Do a global restore if required -->
    <Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
    <Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />

    <!-- Step 2 Detect project specific changes -->
    <ItemGroup>
      <MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
      <!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
      <MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
      <PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
    </ItemGroup>
    <Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
    <PropertyGroup>
      <PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
      <!-- MyProject.fsproj.paket.references has the highest precedence -->
      <PaketOriginalReferencesFilePath>$(MSBuildProjectFullPath).paket.references</PaketOriginalReferencesFilePath>
      <!-- MyProject.paket.references -->
      <PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketOriginalReferencesFilePath>
      <!-- paket.references -->
      <PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>

      <DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
      <DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
      <PaketRestoreRequired>true</PaketRestoreRequired>
      <PaketRestoreRequiredReason>references-file-or-cache-not-found</PaketRestoreRequiredReason>
    </PropertyGroup>

    <!-- Step 2 a Detect changes in references file -->
    <PropertyGroup Condition="Exists('$(PaketOriginalReferencesFilePath)') AND Exists('$(PaketReferencesCachedFilePath)') ">
      <PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)'))</PaketRestoreCachedHash>
      <PaketRestoreReferencesFileHash>$([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)'))</PaketRestoreReferencesFileHash>
      <PaketRestoreRequiredReason>references-file</PaketRestoreRequiredReason>
      <PaketRestoreRequired Condition=" '$(PaketRestoreReferencesFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
    </PropertyGroup>

    <PropertyGroup Condition="!Exists('$(PaketOriginalReferencesFilePath)') AND !Exists('$(PaketReferencesCachedFilePath)') ">
      <!-- If both don't exist there is nothing to do. -->
      <PaketRestoreRequired>false</PaketRestoreRequired>
    </PropertyGroup>

    <!-- Step 2 b detect relevant changes in project file (new targetframework) -->
    <PropertyGroup Condition=" '$(DoAllResolvedFilesExist)' != 'true' ">
      <PaketRestoreRequired>true</PaketRestoreRequired>
      <PaketRestoreRequiredReason>target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths)</PaketRestoreRequiredReason>
    </PropertyGroup>

    <!-- Step 3 Restore project specific stuff if required -->
    <Message Condition=" '$(PaketRestoreRequired)' == 'true' " Importance="low" Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
    <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
    <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />

    <!-- This shouldn't actually happen, but just to be sure. -->
    <PropertyGroup>
      <DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
      <DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
    </PropertyGroup>
    <Error Condition=" '$(DoAllResolvedFilesExist)' != 'true' AND '$(ResolveNuGetPackages)' != 'False' " Text="One Paket file '@(PaketResolvedFilePaths)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />

    <!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild -->
    <ReadLinesFromFile Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketResolvedFilePaths)' != ''" File="%(PaketResolvedFilePaths.Identity)" >
      <Output TaskParameter="Lines" ItemName="PaketReferencesFileLines"/>
    </ReadLinesFromFile>

    <ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
      <PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
        <Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits>
        <PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
        <PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
        <AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
        <CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
      </PaketReferencesFileLinesInfo>
      <PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
        <Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
        <PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
        <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
        <ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
        <Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
        <AllowExplicitVersion>true</AllowExplicitVersion>
      </PackageReference>
    </ItemGroup>

    <PropertyGroup>
      <PaketCliToolFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath>
    </PropertyGroup>

    <ReadLinesFromFile File="$(PaketCliToolFilePath)" >
      <Output TaskParameter="Lines" ItemName="PaketCliToolFileLines"/>
    </ReadLinesFromFile>

    <ItemGroup Condition=" '@(PaketCliToolFileLines)' != '' " >
      <PaketCliToolFileLinesInfo Include="@(PaketCliToolFileLines)" >
        <PackageName>$([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0])</PackageName>
        <PackageVersion>$([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1])</PackageVersion>
      </PaketCliToolFileLinesInfo>
      <DotNetCliToolReference Include="%(PaketCliToolFileLinesInfo.PackageName)">
        <Version>%(PaketCliToolFileLinesInfo.PackageVersion)</Version>
      </DotNetCliToolReference>
    </ItemGroup>

    <!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
    <PropertyGroup>
      <RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
    </PropertyGroup> -->

  </Target>

  <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
    <PropertyGroup>
      <ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
      <DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
      <DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
    </PropertyGroup>
  </Target>

  <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
    <ItemGroup>
      <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
      <MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
      <MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
    </ItemGroup>

    <PropertyGroup>
      <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
      <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
      <UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
      <UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack>
      <UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
      <UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack>
      <UseNuGet4_Pack>false</UseNuGet4_Pack>
      <UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack>
      <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
      <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
    </PropertyGroup>

    <ItemGroup>
      <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/>
    </ItemGroup>

    <Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />

    <ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
      <Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
    </ConvertToAbsolutePath>

    <!-- Call Pack -->
    <PackTask Condition="$(UseMSBuild15_9_Pack)"
              PackItem="$(PackProjectInputFile)"
              PackageFiles="@(_PackageFiles)"
              PackageFilesToExclude="@(_PackageFilesToExclude)"
              PackageVersion="$(PackageVersion)"
              PackageId="$(PackageId)"
              Title="$(Title)"
              Authors="$(Authors)"
              Description="$(Description)"
              Copyright="$(Copyright)"
              RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
              LicenseUrl="$(PackageLicenseUrl)"
              ProjectUrl="$(PackageProjectUrl)"
              IconUrl="$(PackageIconUrl)"
              ReleaseNotes="$(PackageReleaseNotes)"
              Tags="$(PackageTags)"
              DevelopmentDependency="$(DevelopmentDependency)"
              BuildOutputInPackage="@(_BuildOutputInPackage)"
              TargetPathsToSymbols="@(_TargetPathsToSymbols)"
              SymbolPackageFormat="symbols.nupkg"
              TargetFrameworks="@(_TargetFrameworks)"
              AssemblyName="$(AssemblyName)"
              PackageOutputPath="$(PackageOutputAbsolutePath)"
              IncludeSymbols="$(IncludeSymbols)"
              IncludeSource="$(IncludeSource)"
              PackageTypes="$(PackageType)"
              IsTool="$(IsTool)"
              RepositoryUrl="$(RepositoryUrl)"
              RepositoryType="$(RepositoryType)"
              SourceFiles="@(_SourceFiles->Distinct())"
              NoPackageAnalysis="$(NoPackageAnalysis)"
              MinClientVersion="$(MinClientVersion)"
              Serviceable="$(Serviceable)"
              FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
              ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
              NuspecOutputPath="$(AdjustedNuspecOutputPath)"
              IncludeBuildOutput="$(IncludeBuildOutput)"
              BuildOutputFolder="$(BuildOutputTargetFolder)"
              ContentTargetFolders="$(ContentTargetFolders)"
              RestoreOutputPath="$(RestoreOutputAbsolutePath)"
              NuspecFile="$(NuspecFileAbsolutePath)"
              NuspecBasePath="$(NuspecBasePath)"
              NuspecProperties="$(NuspecProperties)"/>

    <PackTask Condition="$(UseMSBuild15_8_Pack)"
              PackItem="$(PackProjectInputFile)"
              PackageFiles="@(_PackageFiles)"
              PackageFilesToExclude="@(_PackageFilesToExclude)"
              PackageVersion="$(PackageVersion)"
              PackageId="$(PackageId)"
              Title="$(Title)"
              Authors="$(Authors)"
              Description="$(Description)"
              Copyright="$(Copyright)"
              RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
              LicenseUrl="$(PackageLicenseUrl)"
              ProjectUrl="$(PackageProjectUrl)"
              IconUrl="$(PackageIconUrl)"
              ReleaseNotes="$(PackageReleaseNotes)"
              Tags="$(PackageTags)"
              DevelopmentDependency="$(DevelopmentDependency)"
              BuildOutputInPackage="@(_BuildOutputInPackage)"
              TargetPathsToSymbols="@(_TargetPathsToSymbols)"
              TargetFrameworks="@(_TargetFrameworks)"
              AssemblyName="$(AssemblyName)"
              PackageOutputPath="$(PackageOutputAbsolutePath)"
              IncludeSymbols="$(IncludeSymbols)"
              IncludeSource="$(IncludeSource)"
              PackageTypes="$(PackageType)"
              IsTool="$(IsTool)"
              RepositoryUrl="$(RepositoryUrl)"
              RepositoryType="$(RepositoryType)"
              SourceFiles="@(_SourceFiles->Distinct())"
              NoPackageAnalysis="$(NoPackageAnalysis)"
              MinClientVersion="$(MinClientVersion)"
              Serviceable="$(Serviceable)"
              FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
              ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
              NuspecOutputPath="$(AdjustedNuspecOutputPath)"
              IncludeBuildOutput="$(IncludeBuildOutput)"
              BuildOutputFolder="$(BuildOutputTargetFolder)"
              ContentTargetFolders="$(ContentTargetFolders)"
              RestoreOutputPath="$(RestoreOutputAbsolutePath)"
              NuspecFile="$(NuspecFileAbsolutePath)"
              NuspecBasePath="$(NuspecBasePath)"
              NuspecProperties="$(NuspecProperties)"/>

    <PackTask Condition="$(UseNuGet4_Pack)"
              PackItem="$(PackProjectInputFile)"
              PackageFiles="@(_PackageFiles)"
              PackageFilesToExclude="@(_PackageFilesToExclude)"
              PackageVersion="$(PackageVersion)"
              PackageId="$(PackageId)"
              Title="$(Title)"
              Authors="$(Authors)"
              Description="$(Description)"
              Copyright="$(Copyright)"
              RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
              LicenseUrl="$(PackageLicenseUrl)"
              ProjectUrl="$(PackageProjectUrl)"
              IconUrl="$(PackageIconUrl)"
              ReleaseNotes="$(PackageReleaseNotes)"
              Tags="$(PackageTags)"
              TargetPathsToAssemblies="@(_TargetPathsToAssemblies->'%(FinalOutputPath)')"
              TargetPathsToSymbols="@(_TargetPathsToSymbols)"
              TargetFrameworks="@(_TargetFrameworks)"
              AssemblyName="$(AssemblyName)"
              PackageOutputPath="$(PackageOutputAbsolutePath)"
              IncludeSymbols="$(IncludeSymbols)"
              IncludeSource="$(IncludeSource)"
              PackageTypes="$(PackageType)"
              IsTool="$(IsTool)"
              RepositoryUrl="$(RepositoryUrl)"
              RepositoryType="$(RepositoryType)"
              SourceFiles="@(_SourceFiles->Distinct())"
              NoPackageAnalysis="$(NoPackageAnalysis)"
              MinClientVersion="$(MinClientVersion)"
              Serviceable="$(Serviceable)"
              AssemblyReferences="@(_References)"
              ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
              NuspecOutputPath="$(AdjustedNuspecOutputPath)"
              IncludeBuildOutput="$(IncludeBuildOutput)"
              BuildOutputFolder="$(BuildOutputTargetFolder)"
              ContentTargetFolders="$(ContentTargetFolders)"
              RestoreOutputPath="$(RestoreOutputAbsolutePath)"
              NuspecFile="$(NuspecFileAbsolutePath)"
              NuspecBasePath="$(NuspecBasePath)"
              NuspecProperties="$(NuspecProperties)"/>
  </Target>
  <!--/+:cnd:noEmit-->
</Project>
